package com.xiaohudie.dao;

import com.xiaohudie.Param.StudentParam;
import com.xiaohudie.entity.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author xiao hu die
 * @Date 2022/3/14 21:52
 * @Version 1.0
 */
public interface StudentDao {
    /**查询一个学生*/
    Student selectStudentById();
    /**根据id查询学生对象*/
    Student selectStudentByIdParam(@Param("id") Integer id);
    /**添加学生对象*/
    Integer insertStudent(Student student);
    /**测试selectMap*/
    Map<String,Student> selectMap();
    /**查询所有student对象*/
    List<Student> selectStudentList();
    /**@Param注解
     * 进行参数绑定使用的注解
     * 多个简单的参数传值使用的 */
    List<Student> selectStudentParam(@Param("age")Integer age,
                                     @Param("name")String name);
    /**传入整个对象*/
    List<Student> selectStudentObject(StudentParam studentParam);
    /**按位置传入参数*/
    List<Student> selectStudentArgs(String name , Integer age);
    /**测试$占位符出现sql注入的现象*/
    List<Student> selectStudentSql(String name);
    /**使用列名排序*/
    List<Student> selectStudentcloum(@Param("cloum") String cloum);
    /**返回值类型是基本数据类型*/
    Integer selectCount();
    /**返回值是map类型*/
    HashMap<String,Object> selectMap2(@Param("id") Integer id);
    /**测试模糊查询*/
    List<Student> selectStudentLike(@Param("name") String name);
    /**测试where*/
    List<Student> selectStudentWhere(StudentParam studentParam);
    /**测试foreach*/
    List<Student> selectStudentForeach(List<Integer> integers);
    Integer InsertForeach(@Param("list") List<Student> studentList);
    Integer DeleteForeach(@Param("list") List<Integer> list);
    /**测试pageHepler*/
    List<Student> selectStudentPage();
}
